public class  CheckPermutation {
	  public static String sort(String str){
	    char[] charArr = str.toCharArray();
	    Arrays.sort(charArr);
	    String nstr = new String(charArr);
	    
	    return nstr;
	  }
	  
	  public boolean isPermutation(String origin,String nstr) {
	  
	    return sort(origin).equals(sort(nstr));
	  }
	}